package game.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import common.model.po.GRecipe;
import common.model.request.base.PaginationRequest;
import common.model.response.base.Result;
import game.model.request.SaveRecipeRequest;
import game.model.request.SearchRecipeRequest;
import game.model.vo.SearchRecipeVo;

/**
 * 配方和原料的多对多关系服务类
 *
 * @author 米泽鹏
 * @since 2022-02-26
 */
public interface GRecipeService extends IService<GRecipe> {

	/**
	 * 根据物品或建筑id查询制作该物品或建筑的所有配方
	 *
	 * @param paginationRequest PaginationRequest<SearchRecipeRequest, GRecipe>
	 * @return 所有配方
	 */
	Page<SearchRecipeVo> pageRecipe(PaginationRequest<SearchRecipeRequest, GRecipe> paginationRequest);

	SearchRecipeVo getRecipeDetailById(Long recipeId);

	/**
	 * 配方新增或更新（产物是物品或建筑时复用）
	 *
	 * @param request SaveRecipeRequest
	 * @return Result
	 */
	Result<?> saveRecipe(SaveRecipeRequest request);

	/**
	 * 配方删除
	 *
	 * @param id Long
	 * @return Result
	 */
	Result<?> deleteRecipe(Long id);

}
